import request from '@/utils/request'

// 查询拼团活动列表
export function listBuying(query) {
  return request({
    url: '/admin/SGroup/groupBuyingList',
    method: 'get',
    params: query
  })
}

// 查询拼团活动详细
export function getBuying(groupBuyingId) {
  return request({
    url: 'admin/SGroup/groupUserList/buying/' + groupBuyingId,
    method: 'get'
  })
}

// 新增拼团活动
export function addBuying(data) {
  return request({
    url: '/system/buying',
    method: 'post',
    data: data
  })
}

// 修改拼团活动
export function updateBuying(data) {
  return request({
    url: '/system/buying',
    method: 'put',
    data: data
  })
}

// 删除拼团活动
export function delBuying(groupBuyingId) {
  return request({
    url: '/system/buying/' + groupBuyingId,
    method: 'delete'
  })
}
